// Unintentional assignment
let x;
if (x = 0) {
  const b = 1;
}

// Practical example that is similar to an error
const setHeight = function (someNode) {
  do {
    someNode.height = "100px";
  } while (someNode = someNode.parentNode);
}

// Practical example that wraps the assignment in parentheses
const set_height = function (someNode) {
  do {
    someNode.height = "100px";
  } while ((someNode = someNode.parentNode));
}

// Practical example that wraps the assignment and tests for 'null'
const heightSetter = function (someNode) {
  do {
    someNode.height = "100px";
  } while ((someNode = someNode.parentNode) !== null);
}

if (someNode || (someNode = parentNode)) { }

while (someNode || (someNode = parentNode)) { }

do { } while (someNode || (someNode = parentNode));

for (; (typeof l === 'undefined' ? (l = 0) : l); i++) { }

if (x = 0) { }

while (x = 0) { }

do { } while (x = x + 1);
do { } while (x = x + 1);

for(; x = y; ) { }

while ((x = 0)) { }

do { } while ((x = x + 1));

for(; (x = y); ) { }